<template>
    <div>
      <Modal width="1200"  footer-hide v-model="normalReportDetailShow" title="佣金详情" >
        <div class="report-content">
          <!--F1 报备详情 -->
          <div class="detail report-detail">
            <h3 class="sub-title">报备信息</h3>
            <Table border :columns="reportColumns" :data="reportData"></Table>
          </div>
          <div class="detail commission-detail">
            <h3 class="sub-title">签约及佣金信息</h3>
            <Table border :columns="reportColumns" :data="reportData"></Table>
          </div>
        </div>
      </Modal>
    </div>
</template>

<script>
import { formatTime } from '@/utils'
import Api from '@/api'

const report = Api.report
export default {
  name: 'normalReportDetailModal',
  components: {
  },
  data() {
    return {
      normalReportDetailShow: false,
      reportDetail: {},
      reportData: [],
      reportColumns: [ // 报备信息
        { title: '报备Id', key: 'id' },
        { title: '渠道商户', key: 'devCompany' },
        { title: '楼盘名称', key: 'premisesName' },
        { title: '经纪人', key: 'accountName' },
        { title: '经纪人公司', key: 'agentCompany' },
        { title: '客户姓名', key: 'customerName' },
        { title: '客户手机', key: 'mobile' },
        {
          title: '预计到访时间',
          key: 'hopeVisitTime',
          minWidth: 160,
          width: 160,
          render: (h, params) => (
            h('div', {}, formatTime(params.row.hopeVisitTime, 'second'))
          )
        },
        { title: '报备状态', key: 'customerStatus' },
        { title: '交易状态', key: 'confirmStatus' },
        {
          title: '报备时间',
          key: 'createTime',
          minWidth: 160,
          width: 160,
          render: (h, params) => (
            h('div', {}, formatTime(params.row.createTime, 'second'))
          )
        },
      ],
      commissionColumns: [
        { title: '楼栋', key: '' },
        { title: '房间号', key: '' },
        { title: '计价面积(㎡)', key: '' },
        { title: '成交总价(元)', key: '' },
        { title: '结佣方式', key: '' },
        { title: '结佣周期', key: '' },
        { title: '结佣周期', key: '' },
        { title: '应结佣金', key: '' },
        { title: '佣金状态', key: '' },
        {
          title: '结佣日期',
          key: '',
          render: (h, params) => (
            h('div', {}, formatTime(params.row.createTime, 'second'))
          )
        },
      ]
    }
  },
  methods: {
    initData(reportInfo) {
      this.reportData.push(reportInfo);
      this.normalReportDetailShow = true;
    },
    cleanParams() {
      this.reportData = [];
      this.followData = [];
    },
  }
}
</script>

<style scoped lang="scss">

  .detail {
    .sub-title {
      text-align: left;
      padding-bottom: 15px;
    }
    &.report-detail {
      padding-bottom: 30px;
    }
  }
</style>
